(function() {

    if ( JSK.Test.support ) {

	CKEDITOR.disableAutoInline = true;
	CKEDITOR.inline( 'editor' );

	if ( localStorage[ 'pdfbldr_docid' ] ) {

	    CKEDITOR.instances.editor.setData( localStorage[ 'pdfbldr_content' ] );

	    $( '#gen_docid' ).attr( 'value', localStorage[ 'pdfbldr_docid' ] );

	} else {

	    localStorage[ 'pdfbldr_docid' ] = '';
	    localStorage[ 'pdfbldr_content' ] = CKEDITOR.instances.editor.getData();

	}

	$( '#logger' ).log({
	    warn: 'Please wait while PDFBldr determines its network status'
	});

	setInterval( JSK.Test.online, 5000 );

    } else {

	$( '#logger' ).log({
	    error: 'PDFBldr is not supported by your browser. Do upgrade'
	});

    }

}());
